Skip to content

Migrate build to IntelliJ Platform Gradle Plugin 2.x (Gradle 9, IDE 2026.1)#36

Merged
thomasrepnik merged 7 commits into
masterfrom
chore/gradle9-intellij-platform-plugin-2x
Jul 16, 2026
Merged

Migrate build to IntelliJ Platform Gradle Plugin 2.x (Gradle 9, IDE 2026.1)#36
thomasrepnik merged 7 commits into
masterfrom
chore/gradle9-intellij-platform-plugin-2x

Conversation

@thomasrepnik

@thomasrepnik thomasrepnik commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

./gradlew build was broken after upgrading the toolchain: org.jetbrains.intellij 1.x (every version, incl. 1.17.4) depends on a Gradle-internal class (DefaultArtifactPublicationSet) that Gradle 9 removed, and 1.x also cannot build against IDE targets ≥ 2024.2. This PR completes the upgrade by migrating to JetBrains' successor plugin.

Gradle wrapper 9.6.1 (first commit)

  • Wrapper jar and gradlew/gradlew.bat scripts regenerated via ./gradlew wrapper so they match the 9.6.1 properties file (the manual properties-only edit had left them at 8.4).

Build migration (second commit)

  • org.jetbrains.intellij 1.17.4 → org.jetbrains.intellij.platform 2.11.0
  • IDE dependency via the new dependencies { intellijPlatform { ... } } block using the unified intellijIdea '2026.1.4' distribution (IC is no longer published since 2025.3) + bundledPlugin 'Git4Idea'
  • patchPluginXml/runPluginVerifier blocks replaced by intellijPlatform { pluginConfiguration { ideaVersion { sinceBuild = '261' } } } and pluginVerification { ides { recommended() } }
  • Java target 17 → 21 (required for IDE targets ≥ 2024.2)
  • Plugin version 1.4.1 → 1.4.2; .intellijPlatform cache dir gitignored

Compatibility note: sinceBuild = 261 means users on IDEs older than 2026.1 stop receiving updates (intentional).

Kotlin DSL migration

  • build.gradle/settings.gradle converted to build.gradle.kts/settings.gradle.kts (1:1, no behavior change). The IntelliJ Platform Gradle Plugin 2.x DSL is Kotlin-based, so the Groovy scripts produced unresolvable-method warnings in the IDE; with Kotlin DSL the editor resolves everything cleanly.

Bugfix: focus stolen on branch changeFixes #37

  • CommitPrefixCheckinHandler no longer calls CheckinProjectPanel.setCommitMessage(...) when a CommitMessage component is available: in the non-modal commit UI that call unconditionally focuses the commit editor (CommitProjectPanelAdapter.setCommitMessagecommitMessageUi.focus()), stealing focus from the terminal on every branch switch. The message is now set via the non-focusing CommitMessage.setText(...).
  • The update is skipped entirely when the computed message equals the current one.
  • The GIT_REPO_CHANGE message bus subscription is now tied to the commit UI's lifecycle (parent Disposable), so stale handlers no longer accumulate and re-fire.

Test plan

  • ./gradlew build — compiles, all 133 tests pass on Gradle 9.6.1 / JDK 21
  • ./gradlew buildPlugin — produces commit-prefix-plugin-1.4.2.zip
  • ./gradlew verifyPluginCompatible against IU-261.26222.65 (2026.1) and IU-262.8665.176 (2026.2 EAP), dynamic-plugin eligible
  • Manual runIde: branch switch in the terminal updates the prefix without stealing focus (non-modal UI)

🤖 Generated with Claude Code

thomasrepnik and others added 7 commits July 15, 2026 21:54
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The org.jetbrains.intellij 1.x plugin is EOL: it uses Gradle-internal
API removed in Gradle 9 and cannot build against IDE targets >= 2024.2.
Replace it with org.jetbrains.intellij.platform 2.x using the unified
intellijIdea distribution (IC is no longer published since 2025.3),
raise the Java target to 21 as required by modern IDE targets, and
declare sinceBuild 261. Ignore the plugin's .intellijPlatform cache dir.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Lombok 1.18.34 crashes javac 25 with ExceptionInInitializerError during
compileTestJava. A toolchain makes Gradle compile with a discovered
JDK 21 regardless of the JVM that launches the build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- IntelliJ Platform Gradle Plugin 2.11.0 -> 2.18.1
- JUnit Jupiter/Platform 5.10.3/1.10.3 -> 6.1.2 (unified versioning)
- Hamcrest 2.2 -> 3.0
- Lombok 1.18.34 -> 1.18.46 (adds JDK 25 javac support)
- Replace toolchain pin with source/target compatibility 21 so the
  build runs on the default JDK 25 while emitting Java 21 bytecode

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Improve Git Auto Prefix handling: tie message bus to commit UI, avoid focus issues
@thomasrepnik
thomasrepnik merged commit 69e0393 into master Jul 16, 2026
@thomasrepnik
thomasrepnik deleted the chore/gradle9-intellij-platform-plugin-2x branch July 16, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commit tool window steals focus when the prefix is updated on branch change

1 participant